package com.zhongkun.datahome.service.repository;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongkun.datahome.service.constant.DataAssetsShowScopeEnum;
import com.zhongkun.datahome.service.domain.DataAssets;
import com.zhongkun.datahome.service.mapper.DataAssetsMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Objects;

/**
 * @Author: huangjie
 * @Date: 2025/4/14 17:15
 * @Desc
 */
@Repository
public class DataAssetsRepository extends ServiceImpl<DataAssetsMapper, DataAssets> {
    public List<DataAssets> listAllShowAssets(Long groupTypeId, Integer assetsStatus) {
        return this.list(new LambdaQueryWrapper<DataAssets>()
                .eq(Objects.nonNull(groupTypeId), DataAssets::getGroupTypeId, groupTypeId)
                .eq(Objects.nonNull(assetsStatus), DataAssets::getAssetsStatus, assetsStatus)
                .eq(DataAssets::getShowScope, DataAssetsShowScopeEnum.ALL_SHOW.getScope()));
    }
}
